package com.inspur.mr.sortelectric;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;

import com.inspur.mr.electric.ElectricWritable;

public class ElectricSortDriver {
public static void main(String[] args) throws Exception {
	System.setProperty("HADOOP_USER_NAME", "hadoop");
	Configuration conf = new Configuration();
	Job job = Job.getInstance(conf);
	job.setJarByClass(ElectricSortDriver.class);
	job.setMapperClass(ElectricSortMapper.class);
	job.setOutputKeyClass(ElectricWritable.class);
	job.setOutputValueClass(NullWritable.class);
	FileInputFormat.setInputPaths(job, new Path("hdfs://192.168.56.56:24/out2/part-r-00000"));
    FileOutputFormat.setOutputPath(job, new Path("hdfs://192.168.56.56:24/out3"));
    job.waitForCompletion(true);
}
}